goog.provide('bombernode.Bomb');

goog.require('lime.Circle');

bombernode.Bomb = function(player, arrayPos) {
    lime.Circle.call(this);

    this.player = player;
    this.arrayPos = arrayPos;
    this.player.game.bombs[arrayPos.x][arrayPos.y] = this;

    var xPos = arrayPos.x * this.player.game.BLOCKWIDTH + this.player.game.BLOCKWIDTH / 2;
    var yPos = arrayPos.y * this.player.game.BLOCKHEIGHT + this.player.game.BLOCKHEIGHT / 2;
    this.setPosition(xPos, yPos);
    this.setSize(player.getSize());
    this.setFill('assets/bomb.jpg');

    lime.scheduleManager.callAfter(this.explode, this, 4000);
}
goog.inherits(bombernode.Bomb, lime.Circle);

bombernode.Bomb.prototype.explode = function(){
    this.player.bombs++;
    this.setSize(0, 0);
    this.player.game.bombs[this.arrayPos.x][this.arrayPos.y] = undefined;

    

    //TODO: remove from DOM and stack, but how?
}

